﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Hallenberg.SmartClient.Menu;

namespace Hallenberg.SmartClient.Test.Menu
{
    [TestFixture]
    public class MenuItemAttributeTest
    {
        private const string MenuCollectionName = "MainMenu";
        private const string MenuItemName = "MenuItemName";
        private const string MenuTitle = "Menu Title";
        private const string ResourceMenuTitleName = "TestMenuTitle";

        [Test]
        public void ShouldBeAbleToCreateMenuItemAttribute()
        {
            var attribute = new MenuItemAttribute(MenuCollectionName, MenuItemName, MenuTitle);

            Assert.That(attribute.MenuCollectionName, Is.EqualTo(MenuCollectionName));
            Assert.That(attribute.MenuItemName, Is.EqualTo(MenuItemName));
            Assert.That(attribute.MenuTitle, Is.EqualTo(MenuTitle));
        }

        [Test]
        public void ShouldBeAbleToSetResourceBasedTitle()
        {
            var attribute = new MenuItemAttribute(MenuCollectionName, typeof(Properties.Resources), ResourceMenuTitleName);

            Assert.That(attribute.MenuCollectionName, Is.EqualTo(MenuCollectionName));
            Assert.That(attribute.ResourceType, Is.EqualTo(typeof(Properties.Resources)));
            Assert.That(attribute.ResourceMenuTitle, Is.EqualTo(ResourceMenuTitleName));
        }
    }
}
